﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="AddFilm.aspx.cs"
    Inherits="Manager_Product_AddFilm" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script src="<%= ResolveClientUrl("~/")%>Pub/ckeditor/ckeditor.js" type="text/javascript"></script>

    <div>
        <table cellpadding="3" cellspacing="0" border="0" width="100%">
            <tr>
                <td colspan="3" class="BackgroundItem" align="center">
                    <table width="100%" cellpadding="3" cellspacing="0" border="1" class="tbl_Comon-Search">
                        <tr>
                            <td align="left" colspan="7">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="GrpAdd"
                                    ShowMessageBox="True" ShowSummary="False" />
                            </td>
                        </tr>
                        <tr>
                            <td class="td_Title" align="left" style="width: 212px">
                                Tên phim Eng</td>
                            <td align="left" class="td_Control" nowrap="nowrap" colspan="6" style="white-space: nowrap;">
                                <asp:TextBox ID="txtTenSP" runat="server" ValidationGroup="GrpAdd" Width="70%" CssClass="txt_Product"></asp:TextBox><asp:RequiredFieldValidator
                                    ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTenSP" ErrorMessage="Nhập vào tên sản phẩm"
                                    ValidationGroup="GrpAdd">*</asp:RequiredFieldValidator><asp:CheckBox ID="chkHot"
                                        runat="server" Text="Hot !" ForeColor="Red" /></td>
                        </tr>
                        <tr>
                            <td align="left" class="td_Title" style="width: 212px">
                                Tên tiếng Việt</td>
                            <td align="left" class="td_Control" colspan="6" nowrap="nowrap" style="white-space: nowrap">
                                <asp:TextBox ID="txtFilmNameVN" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="70%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="td_Title" align="left" style="width: 212px">
                                Mã Phim</td>
                            <td align="left" class="td_Control" style="width: 600px">
                                <asp:TextBox ID="txtFilmNo" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="70%"></asp:TextBox></td>
                            <td align="left" class="td_Title" style="width: 111px">
                                <asp:Label ID="Label1" runat="server" Text="Thể loại"></asp:Label></td>
                            <td align="left" class="td_Control" colspan="4" style="white-space: nowrap;">
                                <asp:DropDownList ID="ddlTheLoai" runat="server" CssClass="cssDropdownlist">
                                </asp:DropDownList><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                    ControlToValidate="ddlTheLoai" ErrorMessage="Chọn thể loại" InitialValue="0"
                                    ValidationGroup="GrpAdd">*</asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td align="left" class="td_Title" style="width: 212px">
                                Diễn viên</td>
                            <td align="left" class="td_Control" style="width: 600px">
                                <asp:TextBox ID="txtHero" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="95%"></asp:TextBox></td>
                            <td align="left" class="td_Title" nowrap="nowrap" style="display: none; background-color: #eaeaea">
                            </td>
                            <td align="left" class="td_Title" style="width: 330px">
                                Đạo diễn</td>
                            <td align="left" class="td_Control" style="width: 330px">
                                <asp:TextBox ID="txtDirector" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="95%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="left" class="td_Title" style="width: 212px">
                                Quốc gia</td>
                            <td align="left" class="td_Control" style="width: 600px">
                                <asp:TextBox ID="txtNational" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="95%"></asp:TextBox></td>
                            <td align="left" class="td_Title" nowrap style="background-color: #eaeaea; display: none;">
                                Giá gốc</td>
                            <td align="left" class="td_Title" style="width: 330px">
                                Năm SX</td>
                            <td align="left" class="td_Control" style="width: 330px">
                                <asp:TextBox ID="txtYear" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="95%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td class="td_Title" align="left" style="width: 212px">
                                <asp:Label ID="Label4" runat="server" Text="Âm thanh"></asp:Label></td>
                            <td align="left" class="td_Control" style="width: 600px">
                                &nbsp;<asp:TextBox ID="txtSound" runat="server" ValidationGroup="GrpAdd" Width="95%"
                                    CssClass="txt_Product"></asp:TextBox>
                            </td>
                            <td align="left" class="td_Title" style="width: 111px">
                                <asp:Label ID="Label3" runat="server" Text="Phụ đề"></asp:Label></td>
                            <td align="left" class="td_Control" colspan="4" style="white-space: nowrap;">
                                <asp:TextBox ID="txtSubtitles" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="95%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="left" class="td_Title" style="width: 212px">
                                <asp:Label ID="Label6" runat="server" Text="Dung lượng"></asp:Label></td>
                            <td align="left" class="td_Control" style="width: 600px">
                                <asp:TextBox ID="txtCapacity" runat="server" CssClass="txt_Product" ValidationGroup="GrpAdd"
                                    Width="50%"></asp:TextBox>
                                <asp:Label ID="Label7" runat="server" ForeColor="Red" Text="GB"></asp:Label></td>
                            <td align="left" class="td_Title" style="width: 111px">
                                Định dạng</td>
                            <td align="left" class="td_Control" colspan="4" style="white-space: nowrap">
                                <asp:TextBox ID="txtFormat" runat="server" CssClass="txt_Product" onblur="fnCheckPD(this.value)"
                                    ValidationGroup="GrpAdd" Width="95%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="left" class="td_Title" style="width: 212px">
                                <asp:Label ID="Label2" runat="server" Text="Hình minh họa"></asp:Label></td>
                            <td align="left" class="td_Control" colspan="5" style="white-space: nowrap">
                                &nbsp;<table border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:FileUpload ID="FileU_HinhMinhHoa" runat="server" CssClass="txt_Product" />
                                        </td>
                                        <td>
                                            <img id="imgShowImage" runat="server" height="20" width="20" src="../../Images/Icon/show_image.png"
                                                visible="false" style="cursor: pointer" onmouseover="OpenPopUpTooltip(this)"
                                                onmouseout="HidePopUpTooltip()" />
                                        </td>
                                    </tr>
                                </table>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="center" colspan="7" style="border-bottom-color: #407db3; border-top-color: #407db3;
                                background-color: lightcyan; border-right-color: #407db3">
                                &nbsp;
                                <textarea name="FCKeditor1" id="FCKeditor1" runat="server" style="height: 300px;
                                    width: 95%;"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="td_Control" colspan="7">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="left" colspan="7">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="width: 212px" class="cssManage_Product" align="left">
                            </td>
                            <td align="left" colspan="6">
                                <asp:Button ID="btnUpdate" runat="server" Text="Bảo lưu" CssClass="cssButton" ValidationGroup="GrpAdd"
                                    Width="80px" OnClick="btnUpdate_Click" />
                                <asp:Button ID="btnBack" runat="server" Text="Quay lại" CssClass="cssButton" OnClick="btnBack_Click"
                                    Width="80px" /></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <br />
        <input type="hidden" id="hidDescID" name="hidDescID" />
        <input type="hidden" id="hImg" name="hImg" runat="server" value="" />
        <input type="hidden" id="hidUPdProperties" runat="server" />
        <input id="hidMaSP" runat="server" type="hidden" />
        <br />
        <div style="margin-left: 200px">
            &nbsp;
        </div>
    </div>
    <div class='product_popup' id="divTooltip" onmouseover="OpenDivPopUpTooltip()" onmouseout="HidePopUpTooltip(this)"
        style="position: absolute">
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="3" nowrap="nowrap" rowspan="2" class="product_detail_popup" id="tdProductDetail"
                    style="text-align: center">
                    <img runat="server" id="imgURL" onclick="HidePopUpTooltip()" />
                </td>
            </tr>
            <tr>
            </tr>
        </table>
    </div>

    <script language="javascript" type="text/javascript">
    CKEDITOR.replace(
    document.getElementById("<%= FCKeditor1.ClientID%>")
    );        

    
    function fnDisplayTextMoney(obj)
        {
            obj.value=FormatMoney(obj.value.ReplaceAll(",",""))   ; 
        }
     
     
     
     
     //====================================================================
     
     function OpenPopUpTooltip(obj)
     {  
       obj.style.cursor="pointer";
 
       
        var divTooltip=document.getElementById("divTooltip");
        divTooltip.style.visibility="visible" ;
  
        var sleft=ObjectPosition(obj)[0];       
        var stop=ObjectPosition(obj)[1]-(divTooltip.clientHeight/2);    
     
        divTooltip.style.left = sleft + 'px';
        divTooltip.style.top =  stop+ 'px'; 
    }
    function ObjectPosition(obj) 
    {
          var curleft = 0;
          var curtop = 0;
          if (obj.offsetParent) {
                do {
                      curleft += obj.offsetLeft;
                      curtop += obj.offsetTop;
                } while (obj = obj.offsetParent);
          }
          return [curleft,curtop];
	}
	
	
	 function HidePopUpTooltip(obj)
     { 
             var divTooltip=document.getElementById("divTooltip");
             divTooltip.style.visibility="hidden";

             
     }
     
     function OpenDivPopUpTooltip()
     { 
             var divTooltip=document.getElementById("divTooltip");
             divTooltip.style.visibility="visible"
     }
	
	
   
  
     function trim(str)
     {
        return str.replace(/^\s+/, '').replace(/.*\s+$/, '');
     }
    </script>

</asp:Content>
